﻿using _循环插入数据.Context;
using _循环插入数据.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _循环插入数据
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCopy_Click(object sender, EventArgs e)
        {
            using (var db = new BaseContext())
            {

                MessageBox.Show(db.InterimTable.ToList()[0].Title);
                //Guid d=new Guid("72882A8C-94C9-43FE-AB15-5D5CE6543B0A");
                //List<InterimTable> ItList = db.Set<InterimTable>().ToList();
                //foreach (var t in ItList)
                //{
                //    BaseData_T2Partner t2 = new BaseData_T2Partner();
                //    t2.ID = new Guid();
                //    t2.ProvinceID = db.MBG_Region_Province.Where(x => x.SysOrgName == t.Region).First().ID;
                //    t2.RegionalBusinessLeader = null;
                //    t2.RegionID = db.MBG_Region_Province.Where(x => x.SysOrgName == t.Privcen).First().ID;
                //    t2.ResellerCode = "";
                //    t2.ResellerName = t.Title;
                //    t2.ResellerTypeID = d;
                //    t2.Status = 1;
                //    t2.T2CreateStatus = 0;
                //    t2.AgentLevel = "T3";
                //    t2.CreateBy = "System";
                //    t2.CreateTime = DateTime.Now;
                //    t2.UpdateBy = "System";
                //    t2.UpdateTime = DateTime.Now;
                //    t2.DistrictID = db.MBG_Region_Province.Where(x => x.SysOrgName == t.Privcen).First().ParentID;
                //}
            }
        }
    }
}
